/*
 * @Author: your name
 * @Date: 2020-11-25 12:17:39
 * @LastEditTime: 2021-01-14 11:23:45
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \solax-design\vue.config.js
 */
const path = require('path')
    // const CompressionPlugin = require('compression-webpack-plugin');
    // const productionGzipExtensions = /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i;
module.exports = {
    devServer: {
        proxy: {
            //何雨 http://10.5.0.107:8080/design
            //赵云龙 http://10.5.0.113:8080/design
            //周冬冬 http://10.5.0.103:8080/design
            //公用 http://10.5.0.121:8081/design
            //刘蓉 http://10.5.0.110:8080/design

            '/localApi': {
                target: 'http://www.solaxcloud.com:5066/design',
                ws: true,
                changeOrigin: true,
                pathRewrite: {
                    '^/localApi': '/'
                }
            },
            '/localApiTest': {
                target: 'http://solax02:8088/design',
                ws: true,
                changeOrigin: true,
                pathRewrite: {
                    '^/localApiTest': '/'
                }
            },
            '/api2': {
                target: 'https://www.eu.solaxcloud.com:9443/proxy/', // 服务器端接口地址
                ws: true, //如果要代理 websockets，配置这个参数
                // 如果是https接口，需要配置这个参数
                changeOrigin: true, //是否跨域
                pathRewrite: {
                    '^/api2': '/'
                }
            },
            '/api': {
                //https://www.solaxcloud.com:9443/proxy/,
                target: 'https://www.solaxcloud.com:9443/proxy/', // 服务器端接口地址
                ws: true, //如果要代理 websockets，配置这个参数
                // 如果是https接口，需要配置这个参数
                changeOrigin: true, //是否跨域
                pathRewrite: {
                    '^/api': '/'
                }
            }
        }
    },
    /**/
    publicPath: './',
    // outputDir: '../www',
    assetsDir: "assets",
    productionSourceMap: false,
    // chainWebpack: config => {
    //     config.module
    //         .rule("i18n")
    //         .resourceQuery(/blockType=i18n/)
    //         .type('javascript/auto')
    //         .use("i18n")
    //         .loader("@kazupon/vue-i18n-loader")
    //         .end();
    // }
}